﻿namespace com.vs.General
{
    using System;
    using System.Diagnostics;
    using System.Management;

    public class SystemManager
    {
        public static void CallExe(string exe, string args, bool wait)
        {
            Process process = new Process {
                StartInfo = { Arguments = args, FileName = exe, WindowStyle = ProcessWindowStyle.Hidden }
            };
            process.Start();
            if (wait)
            {
                process.WaitForExit();
            }
        }

        public static string RtrvBiosSerialNum()
        {
            string str = "";
            try
            {
                ManagementObjectCollection instances = new ManagementClass("Win32_Bios").GetInstances();
                foreach (ManagementObject obj2 in instances)
                {
                    if (obj2.Properties["SerialNumber"].Value != null)
                    {
                        str = obj2.Properties["SerialNumber"].Value.ToString();
                    }
                    obj2.Dispose();
                    return str;
                }
                return null;
            }
            finally
            {
            }
        }

        public static string RtrvMachineName()
        {
            return Environment.MachineName;
        }
    }
}

